﻿<Page
    x:Class="BluewaterSoft.Notepad.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BluewaterSoft.Notepad"
    xmlns:dt="using:BluewaterSoft.Notepad.Data"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="120" />
            <RowDefinition Height="20" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Button Content="Button" Style="{StaticResource BackButtonStyle}" Grid.RowSpan="2" Visibility="Collapsed" />

        <TextBlock Text="Simple Notepad" Grid.Column="1" Style="{StaticResource HeaderTextStyle}" VerticalAlignment="Bottom"  />

        <Grid x:Name="DataContainer" Grid.Column="1" Grid.Row="2" Margin="0,0,40,60">
            <Grid.DataContext>
                <dt:TextContentData />
            </Grid.DataContext>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBox  TextWrapping="Wrap" AcceptsReturn="True"
                      Grid.Row="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
                      Text="{Binding TextContent,Mode=TwoWay}" 
                       />
            <TextBlock Text="{Binding Path=StorageFile.Path}" Grid.Row="1" Style="{StaticResource BasicTextStyle}" VerticalAlignment="Bottom"  />
        </Grid>
    </Grid>

	<Page.BottomAppBar>
		<AppBar HorizontalContentAlignment="Stretch" Height="88" VerticalContentAlignment="Stretch" d:LayoutOverrides="Height" Margin="0">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<StackPanel Orientation="Horizontal">
                </StackPanel>
                <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button  Style="{StaticResource SaveAsAppBarButtonStyle}" AutomationProperties.Name="別名で保存" Click="SaveAsButton_Click" />
                    <Button  Style="{StaticResource SaveAppBarButtonStyle}" AutomationProperties.Name="保存" Click="SaveButton_Click" />
                    <Rectangle Width="40" Height="40" />
                    <Button  Style="{StaticResource OpenFileAppBarButtonStyle}" AutomationProperties.Name="開く" Click="OpenFileButton_Click" />
                    <Button Style="{StaticResource AddAppBarButtonStyle}" AutomationProperties.Name="新規" Click="AddButton_Click" />
                </StackPanel>
            </Grid>
		</AppBar>

	</Page.BottomAppBar>


</Page>
